
const Controller = require('egg').Controller

class GetNewsController extends Controller {
    async getcatnews(){
        const ctx = this.ctx
        const id = ctx.params.id
        const page = ctx.params.page
        const catNewsData = await ctx.service.news.getCatNewsList(id,page)
        ctx.body = catNewsData
    }
    async getsearchnews(){
        const ctx = this.ctx
        const keyword = ctx.params.keyword
        const page = ctx.params.page
        const searchData = await ctx.service.news.getSearchNews(keyword,page)
        ctx.body = searchData
    }
}

module.exports = GetNewsController
